<!--
  ~ Copyright (c) 2008-2010. Agwego Enterprises Inc.
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~ of this software and associated documentation files (the "Software"), to deal
  ~ in the Software without restriction, including without limitation the rights
  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~ copies of the Software, and to permit persons to whom the Software is
  ~ furnished to do so, subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in
  ~ all copies or substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  ~ THE SOFTWARE.
  ~
  ~ If you modify this software a credit would be nice
  -->
<html>
<head></head>
<body>

    <a href="" onclick="macs.getMacAddress();"> Get "first" MAC Address</a>
    <br/>
    <br/>
    <a href="" onclick="macs.getMacAddressesJSON();"> Get all MAC Addresses in JSON format</a>

    <!--[if !IE]> Firefox and others will use outer object -->
    <embed type="application/x-java-applet"
           name="macaddressapplet"
           width="0"
           height="0"
           code="MacAddressApplet"
           archive="macaddressapplet.jar"
           pluginspage="http://java.sun.com/javase/downloads/index.jsp"
           style="position:absolute; top:-1000px; left:-1000px;">
        <noembed>
        <!--<![endif]-->
            <!---->
            <object classid="clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA"
                    type="application/x-java-applet"
                    name="macaddressapplet"
                    style="position:absolute; top:-1000px; left:-1000px;"
                    >
                <param name="code" value="MacAddressApplet">
                <param name="archive" value="macaddressapplet.jar" >
                <param name="mayscript" value="true">
                <param name="scriptable" value="true">
                <param name="width" value="0">
                <param name="height" value="0">
              </object>
        <!--[if !IE]> Firefox and others will use outer object -->
        </noembed>
    </embed>
    <!--<![endif]-->

    <script type="text/javascript">
        var macs = {
            getMacAddress : function()
            {
                document.macaddressapplet.setSep( "-" );
                alert( "Mac Address = " + document.macaddressapplet.getMacAddress() );
            },

            getMacAddressesJSON : function()
            {
                document.macaddressapplet.setSep( ":" );
                document.macaddressapplet.setFormat( "%02x" );
                var macs = eval( String( document.macaddressapplet.getMacAddressesJSON() ) );
                var mac_string = "";
                for( var idx = 0; idx < macs.length; idx ++ )
                    mac_string += "\t" + macs[ idx ] + "\n ";

                alert( "Mac Addresses = \n" + mac_string );
            }
        }
    </script>

</body>

</html>